<template>
	<view>
		<top id="我爱你" @gofather="gofather"></top>
		{{$store.state.globalNum}}
		{{$store.getters.changeStateNum}}
		<button type="default" @click="chengeglobalNumsync">同步改变vuex里的值</button>
		<button type="default" @click="chengeglobalNum">异步改变vuex里的值</button>
	</view>
</template>

<script>
	import top from "../../components/top.vue"
	export default {
		data() {
			return {
				
			};
		},
		components:{
				top,
		},
		methods:{
			gofather(data){
				console.log(data)
			},
			chengeglobalNumsync(){
				this.$store.commit("changeNum",55)
			},
			chengeglobalNum(){
				this.$store.dispatch("changeNum1",77)
			}
		}
	}
</script>

<style lang="less">

</style>
